package com.fastshopping.order.service.impl;

import com.fastshopping.order.dao.MaterialMapper;
import com.fastshopping.order.pojo.Material;
import com.fastshopping.order.service.MaterialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/*
 * @Author zhangdan
 * @Description //TODO 素材业务
 * @Date 19:38 2020/6/5
 * @Param
 * @return
 **/
@Service
public class MaterialServiceImpl implements MaterialService {

    @Autowired
    private MaterialMapper materialMapper;


    /*
     * @Author zhangdan
     * @Description //TODO 查询所有素材
     * @Date 19:40 2020/6/5
     * @Param []
     * @return java.util.List<com.fastshopping.order.pojo.Material>
     **/
    @Override
    public List<Material> findAll() {
        return materialMapper.selectAll();
    }

    /*
     * @Author zhangdan
     * @Description //TODO 根据商店id查询素材购买情况
     * @Date 22:08 2020/6/6
     * @Param [id]
     * @return com.fastshopping.order.pojo.Material
     **/
    @Override
    public List<Material> findMaterialById(int storeId) {
        return materialMapper.findMaterialById(storeId);
    }
}
